package com.qf.service.impl;/*
 *保护你的大熊
 *2021/11/29
 *22:42
 */

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsCartMapper;
import com.qf.pojo.DtsCart;
import com.qf.service.DtsCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DtsCartServiceImpl implements DtsCartService {

    @Autowired
    DtsCartMapper cartMapper;

    @Override
    public int findCountByGid(Integer id) {

        LambdaQueryWrapper<DtsCart> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsCart::getDeleted,false);
        wrapper.eq(DtsCart::getGoodsId,id);

        return cartMapper.selectCount(wrapper);
    }
}
